package com.itheima.userservice.Interceptor;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;

@Slf4j
public class MyInterceptor implements WebRequestInterceptor {
    //todo::未完成的的拦截器

    @Override
    public void preHandle(WebRequest webRequest) throws Exception {
        System.out.println("preHandle()执行成功");
    }

    @Override
    public void postHandle(WebRequest webRequest, ModelMap modelMap) throws Exception {
        System.out.println("postHandle()执行成功");
    }

    @Override
    public void afterCompletion(WebRequest webRequest, Exception e) throws Exception {
        System.out.println("afterCompletion()执行成功");
    }
}
